package demo;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 石方旭
 * Date: 2022-08-10
 * Time: 10:50
 */
public class TestDemo3 {

    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(1);
        atomicInteger.getAndIncrement();//相当于后置++
        atomicInteger.incrementAndGet();//相当于前置++
        atomicInteger.decrementAndGet();//相当于前置--
        atomicInteger.getAndDecrement();//相当于后置--
    }

}
